package com.bdqn.Practice.controller;

import com.bdqn.Practice.pojo.SysUser;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping(value = "/user")
public class HelloController  {
//    @Override
//    protected ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
//        System.out.println("Spring MVC框架搭建成功。");
//        return new ModelAndView("hello") ;
//    }
    @RequestMapping(value = "/insert",method = RequestMethod.POST)
    public ModelAndView hello(SysUser sysUser) throws Exception{
        System.out.println(sysUser.getAccount());

        return null;
    }
    @GetMapping(value = "app")
    public String app(){

        return "index";
    }
}
